<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html>
<html>
<head>
	<title>编辑景点</title>

	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<!-- 引入bootstrap -->
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/bootstrap.min.css">
	<!-- 引入JQuery  bootstrap.js-->
	<script src="<%=request.getContextPath()%>/js/jquery-3.2.1.min.js"></script>
	<script src="<%=request.getContextPath()%>/js/bootstrap.min.js"></script>
</head>
<body>
	<!-- 顶栏 -->
	<jsp:include page="top.jsp"></jsp:include>
	<!-- 中间主体 -->
		<div class="container" id="content">
		<div class="row">
			<jsp:include page="menu.jsp"></jsp:include>
			<div class="col-md-10">
				<div class="panel panel-default">
				    <div class="panel-heading">
						<div class="row">
					    	<h1 style="text-align: center;">修改景点信息</h1>
						</div>
				    </div>
				    <div class="panel-body">
						<form enctype="multipart/form-data" class="form-horizontal" role="form" action="<%=request.getContextPath()%>/admin/Scenery/doEditScenery" id="editfrom" method="post">
							<div class="form-group">
							    <label for="inputEmail3" class="col-sm-2 control-label">序号</label>
							    <div class="col-sm-10">
							      <input readonly="readonly"  type="number" class="form-control" id="inputEmail3" value="${scenery.id}" name="id" placeholder="请输入景点序号">
							    </div>
							  </div>
							<div class="form-group">
							    <label for="sname" class="col-sm-2 control-label">景点名称</label>
									<div class="col-sm-10">
							      <input type="text" class="form-control" id="sname" name="sname" value="${scenery.sname}" placeholder="请输入景点名称">
							    </div>
							</div>
							<div class="form-group">
								<label for="images" class="col-sm-2 control-label">景点头像选择器</label>
								<div class="col-sm-10">
									<input type="file" name="file">
									<img width="50px" height="50px" id="images" alt="景点头像" src="/image/${scenery.tximg}">
								</div>
							</div>
							<div class="form-group">
								<label for="floor" class="col-sm-2 control-label">景点地址</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="floor" name="floor" value="${scenery.floor}" placeholder="请输入地址">
								</div>
							</div>
							<div class="form-group">
								<label for="description" class="col-sm-2 control-label">景点简介</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="description" name="description" value="${scenery.description}" placeholder="请输入简介">
								</div>
							</div>
							<div class="form-group">
								<label for="latitude" class="col-sm-2 control-label">景点纬度</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="latitude" name="latitude" value="${scenery.latitude}" placeholder="请输入景点纬度">
								</div>
							  </div>
							<div class="form-group">
								<label for="longitude" class="col-sm-2 control-label">景点经度</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="longitude" name="longitude" value="${scenery.longitude}" placeholder="请输入景点经度">
								</div>
							</div>
							<div class="form-group">
								<label for="width" class="col-sm-2 control-label">Marker图标高/宽</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="width" name="width" value="${scenery.width}" placeholder="请输入高/宽">
								</div>
							</div>

<%--							<div class="form-group">--%>
<%--								<label for="width" class="col-sm-2 control-label">Marker类型选择器</label>--%>
<%--								<div class="col-sm-10">--%>
<%--									<input type="file" name="file">--%>
<%--									<img width="50px" height="50px" id="iconPath" alt="Marker类型选择器" src="/image/${scenery.iconPath}">--%>
<%--								</div>--%>
<%--							</div>--%>
<%--							<div class="form-group">--%>
<%--								<label for="width" class="col-sm-2 control-label">景点展示图</label>--%>
<%--								<div class="col-sm-10">--%>
<%--									<input type="file" name="file">--%>
<%--									<img width="50px" height="50px" id="img" alt="景点展示图" src="/image/${scenery.img}">--%>
<%--								</div>--%>
<%--							</div>--%>

							<div class="form-group">
								  <label for="sceneryLists" class="col-sm-2 control-label" name="grade">所属类别</label>
								  <div class="col-sm-10">
									  <select class="form-control" name="sceneryLists" id="sceneryLists">
										  <c:forEach items="${sceneryLists}" var="item">
											  <option value="${item.sceneryid}">${item.sceneryname}</option>
										  </c:forEach>
									  </select>
								  </div>
							  </div>
							<div class="form-group" style="text-align: center">
								<button class="btn btn-default" type="submit">提交</button>
								<button class="btn btn-default" type="reset">重置</button>
							</div>
						</form>
						<a href="https://jingweidu.bmcx.com/" target="_blank">经纬度查询</a>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="container" id="footer">
	<div class="row">
		<div class="col-md-12"></div>
	</div>
	</div>
</body>
	<script type="text/javascript">
		$("#nav li:nth-child(3)").addClass("active")

		var sceneryListsSelect = $("#sceneryLists option");
		for (var i=0; i<sceneryListsSelect.length; i++) {
			if (sceneryListsSelect[i].value == '${scenery.scenerylistid}') {
				sceneryListsSelect[i].selected = true;
			}
		}
	</script>
</html>